import request from '@/utils/request'

// 查询实有安防设施列表
export function listFacilities(query) {
  return request({
    url: '/community/facilities/list',
    method: 'get',
    params: query
  })
}

// 查询实有设备列表
export function listfacilities(query) {
  return request({
    url: '/community/facilities/listfacilities',
    method: 'get',
    params: query
  })
}

// 查询实有安防设施详细
export function getFacilities(id) {
  return request({
    url: '/community/facilities/' + id,
    method: 'get'
  })
}

// 新增实有安防设施
export function addFacilities(data) {
  return request({
    url: '/community/facilities',
    method: 'post',
    data: data
  })
}

// 修改实有安防设施
export function updateFacilities(data) {
  return request({
    url: '/community/facilities',
    method: 'put',
    data: data
  })
}

// 删除实有安防设施
export function delFacilities(id) {
  return request({
    url: '/community/facilities/' + id,
    method: 'delete'
  })
}

export function securityFacilitiesTypeList() {
  return request({
    url: '/community/facilities/getSecurityFacilitiesType',
    method: 'get'
  })
}

// 根据小区id获取设备列表
export function getGateByDictId(id) {
  return request({
    url: '/community/facilities/getGateByDictId/' + id,
    method: 'get'
  })
}
// 实有设备查询
export function getSecurityFacilitiesCount() {
  return request({
    url: '/community/facilities/getSecurityFacilitiesCount/',
  })
}
